package com.harisucici.websocketlib.room;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.harisucici.websocketlib.entities.receive.SessionListReceive;

@Database(entities = {SessionListReceive.class}, version = 1, exportSchema = false)
public abstract class SessionListDataBase extends RoomDatabase {
    private static SessionListDataBase sessionListDataBase;

    public static synchronized SessionListDataBase getInstance(Context context) {
        if (sessionListDataBase == null) {
            // 构建
            sessionListDataBase = Room.databaseBuilder(
                    context,
                    SessionListDataBase.class,

                    "session_list").build();
        }
        return sessionListDataBase;
    }

    public abstract SessionListDao sessionListReceiveDao();
}
